<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="doSomething()">按钮1</button>
    <hr>

    <div id="hello" title="this is a div">哈哈</div>
    用户名: <input type="text" id="username"> <br>
    勾选表示同意: <input type="checkbox" id="agree"> <br>
    
    <ul id="content">
        <li>tom</li>
        <li>jack</li>
        <li>alice</li>
    </ul>


    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
        function doSomething(){
            // console.log($('#hello').attr('title'))
            // $('#hello').attr('title', '这是一个非常帅气的div')

            // console.log($('#username').val())
            // $('#username').val('alice')

            // console.log($('#agree').prop('checked'))
            // $('#agree').prop('checked', true)

            /**
             * 创建节点
             */ 
            // $('#content').append($('<li>').text('mike'))

            $('#content').empty()

        }
    </script>
</body>
</html>